package com.elitetyc.customview.custom;

import android.app.Dialog;
import android.content.Context;
import android.graphics.Paint;
import android.view.Gravity;
import android.view.MotionEvent;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.TextView;

import com.elitetyc.customview.R;

import java.util.zip.Inflater;

/**
 * Created by elitetyc on 2019/6/17.
 * Describe:
 */
public class GenderDialog extends Dialog {

    private TextView tv_man,tv_woman,tv_cancel;

    public GenderDialog(Context context) {
        this(context,R.style.MyDialog);
    }

    public GenderDialog(Context context, int styleRes) {
        super(context,styleRes);
        setContentView(R.layout.dialog_gender);
        tv_man = findViewById(R.id.tv_man);
        tv_woman = findViewById(R.id.tv_women);
        tv_cancel = findViewById(R.id.tv_cancel);

        Window window = getWindow();
        WindowManager.LayoutParams lp = window.getAttributes();
        lp.gravity = Gravity.BOTTOM; // 居中位置
        lp.width = WindowManager.LayoutParams.MATCH_PARENT;
        lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
        window.setAttributes(lp);
        window.setWindowAnimations(R.style.mystyle);  //添加动画
    }

    public void setManClick(View.OnClickListener onClickListener){
        tv_man.setOnClickListener(onClickListener);
    }

    public void setWoManClick(View.OnClickListener onClickListener){
        tv_woman.setOnClickListener(onClickListener);
    }

    public void setCancelClick(View.OnClickListener onClickListener){
        tv_cancel.setOnClickListener(onClickListener);
    }


}
